﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace Kopytko
{
    public class MessageBoxBase : UserControl
    {
        public event EventHandler BeforeClose;

        public void OnBeforeClose()
        {
            if (BeforeClose!=null)
            {
                BeforeClose(this, new EventArgs());
            }
        }

        public MessageBoxResult Result { get; protected set; }

        protected void OkButton_Click(object sender, RoutedEventArgs e)
        {
            //_result = true;
            //HideHandlerDialog();

            OnBeforeClose();
        }

        protected void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            Result = MessageBoxResult.Cancel;

            OnBeforeClose();
        }
    }
}
